package com.bw.service.impl;

import java.text.SimpleDateFormat;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bw.bean.ylq.Interview;
import com.bw.bean.ylq.Student;
import com.bw.dao.IYlqDao;
import com.bw.service.IYlqService;

@Service
public class YlqServiceImpl implements IYlqService {

	@Autowired
	private IYlqDao dao;
	
	public Student selectStudentById(int sid) throws Exception {
		Student student = dao.selectStudentById(sid);
		return student;
	}

	public void addInterview(Interview interview) throws Exception {
		
		/*SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
		interview.setPresentdate(simpleDateFormat.parse(interview.getTime()));*/
		
		if(interview.getIid()==null){
			dao.addInterview(interview);
		}else if(interview.getIid()>0){
			dao.updateInterview(interview);
		}
	}
/*
	public Interview selectInterview(int iid) throws Exception {
		Interview interview = dao.selectInterview(iid);
		String mstime = interview.getMstime();
		String[] split = mstime.split(":");
		interview.setHour(split[0]);
		interview.setMinute(split[1]);
		return interview;
	}*/


}
